#ifndef OPERATESET_HPP
#define OPERATESET_HPP

#include <QSettings>
#include <QVariant>

class OperateSet{
public:
    static void writeSetting(const QString &group, const QString &key, const QVariant &value)      //写ini文件
    {
        QSettings settings("./setting.ini", QSettings::IniFormat); // 当前目录的INI文件
        settings.beginGroup(group);
        settings.setValue(key,value);
    }

    static QVariant readSetting(const QString &group, const QString &key, const QVariant &defaultvalue)        //读ini文件
    {
        QVariant val;
        QString keypos=group+"/"+key;
        QSettings settings("./setting.ini", QSettings::IniFormat); // 当前目录的INI文件
        val=settings.value(keypos,defaultvalue);
        return val;
    }
};

#endif // OPERATESET_HPP
